package warthog;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;

public final class WartHog {
	public static void main(String[] args) {
		System.err.println("Hello from Wart Hog.");
		for (String path:args) {
			System.err.println("Processing "+path);
			try {
				if (path.endsWith(".whs")) new warthog.scangen.Bend(new File(path)).bend();
				else if (path.endsWith(".whp")) new warthog.parsegen.MetaParser(new File(path)).run();
				else System.err.println("File extension is not \".whs\" or \".whp\". Skipping.");
			} catch (FileNotFoundException e) {
				System.err.println("File not found. Skipping.");
			} catch (IOException e) {
				e.printStackTrace();
				System.exit(2);
			}
		}
		System.err.println("All done.");
	}
}
